package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.mapper.RegisterNeckCollectionMapper;
import com.sc.nft.entity.RegisterNeckCollection;
import com.sc.nft.service.RegisterNeckCollectionService;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * (RegisterNeckCollection)表Dao层
 *
 * @author 王伟成
 * @since 2023-12-01 15:43:09
 */
@Slf4j
@Repository
public class RegisterNeckCollectionDao extends ServiceImpl<RegisterNeckCollectionMapper, RegisterNeckCollection> {

    public RegisterNeckCollection getOneByUserId(Long id) {
        LambdaQueryWrapper<RegisterNeckCollection> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(RegisterNeckCollection::getUserId, id);
        return getOne(lambdaQueryWrapper);
    }
}
